package com.hnkywl.sts.action.flow.endState;

import com.hnkywl.sts.util.ApplicationInstance;
import com.hnkywl.sts.entity.jhgl.Xy;
import com.hnkywl.sts.service.jhgl.XyService;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;

/**
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-4-26
 * Time: 下午7:20
 * To change this template use File | Settings | File Templates.
 */
public class EndXyState implements EventListener {

    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        // 改变状态  ytj--->ysp
        XyService xyService = ApplicationInstance.createXyService();
        Xy xy = xyService.findXyDetailByProcessInstance(execution.getProcessInstance().getId());
        xy.setXyzt("ysp");
        xyService.editXy(xy, xy.getXyhm());
    }

}
